# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-normality
_pkgname=normality
_pyver=3.13
pkgver=2.5.0
pkgrel=5
pkgdesc='Micro-library to normalize text strings.'
arch=('any')
url='https://pypi.org/project/normality/#files'
license=('MIT')
depends=('python' 'python-six' 'python-chardet' 'python-pyicu' 'python-banal')
makedepends=('python-pip' 'python-build' 'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('62ec1d8a6cf22b54ec77ebfb6fe9e49d5f8dac5c1226698fcd1b84b72c6487805b1811c7c532e78937bab25d6d00c8e2fa1ea30c998df3244dda02663f52d2a7')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname

  rm -rf "$pkgdir/usr/lib/python$_pyver/site-packages/tests"
}

